/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simrace;

/**
 *
 * @author Eyo
 */
public class SimRace {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws InterruptedException {
        Race race = new Race();
        for (int i = 0; i < Race.cars; ++i)
            race.addCar(new Car(i));
       
        Accident a = new Accident(race.allCars);
        
        race.startRace();
        a.start();
        
        for(Car c : race.allCars) 
            c.join();
        a.interrupt();
        
        race.sortAllCars();
    }
}
